/**
 * @file   TianwangFile.hpp
 * @author Tu Qichen <tqc@Altavista>
 * @date   Thu Jun 28 19:59:53 2007
 *
 * @brief This Class is use to store and read Tianwang Format dat
 *
 */



#ifndef __TIANWANGFILE_HPP
#define __TIANWANGFILE_HPP

enum TFLAG{TREAD,TWRITE};

#include "Url.hpp"
#include "Page.hpp"
#include <string>
#include <fstream>

class TianwangFile
{
public:
    /**
     * store data
     *
     * @param outfile
     * @param crUrl
     * @param crPage
     *
     * @return
     */
    int Store(std::ofstream& outfile,const Url& crUrl, const Page& crPage);
    int Read(std::ifstream& infile,Page& crPage);
    int Test(std::string fromStr);
};

#endif
